package br.com.projetofx.habernateUtil;

import javax.persistence.EntityManager;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class HabernateUtil {

	private static EntityManager em = null;

	private HabernateUtil() {

	}

	public static EntityManager getInstance() {
		if (em == null) {
			EntityManagerFactory emf = 
					 Persistence.createEntityManagerFactory("projetofx");
			em = emf.createEntityManager();
		}
		return em;
	}
}